Optimal. Leaf size=43 \[ \frac {a^2 x^{1+m}}{1+m}+\frac {2 a b x^{2+m}}{2+m}+\frac {b^2 x^{3+m}}{3+m} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 1, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {45}
\begin {gather*} \frac {a^2 x^{m+1}}{m+1}+\frac {2 a b x^{m+2}}{m+2}+\frac {b^2 x^{m+3}}{m+3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rubi steps
\begin {align*} \int x^m (a+b x)^2 \, dx &=\int \left (a^2 x^m+2 a b x^{1+m}+b^2 x^{2+m}\right ) \, dx\\ &=\frac {a^2 x^{1+m}}{1+m}+\frac {2 a b x^{2+m}}{2+m}+\frac {b^2 x^{3+m}}{3+m}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 38, normalized size = 0.88 \begin {gather*} x^{1+m} \left (\frac {a^2}{1+m}+\frac {2 a b x}{2+m}+\frac {b^2 x^2}{3+m}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 51, normalized size = 1.19
method | result | size |
norman | \(\frac {a^{2} x \,{\mathrm e}^{m \ln \left (x \right )}}{1+m}+\frac {b^{2} x^{3} {\mathrm e}^{m \ln \left (x \right )}}{3+m}+\frac {2 a b \,x^{2} {\mathrm e}^{m \ln \left (x \right )}}{2+m}\) | \(51\) |
risch | \(\frac {x \left (b^{2} m^{2} x^{2}+2 a b \,m^{2} x +3 b^{2} m \,x^{2}+a^{2} m^{2}+8 a b m x +2 x^{2} b^{2}+5 a^{2} m +6 a b x +6 a^{2}\right ) x^{m}}{\left (3+m \right ) \left (2+m \right ) \left (1+m \right )}\) | \(86\) |
gosper | \(\frac {x^{1+m} \left (b^{2} m^{2} x^{2}+2 a b \,m^{2} x +3 b^{2} m \,x^{2}+a^{2} m^{2}+8 a b m x +2 x^{2} b^{2}+5 a^{2} m +6 a b x +6 a^{2}\right )}{\left (3+m \right ) \left (2+m \right ) \left (1+m \right )}\) | \(87\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 43, normalized size = 1.00 \begin {gather*} \frac {b^{2} x^{m + 3}}{m + 3} + \frac {2 \, a b x^{m + 2}}{m + 2} + \frac {a^{2} x^{m + 1}}{m + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.16, size = 85, normalized size = 1.98 \begin {gather*} \frac {{\left ({\left (b^{2} m^{2} + 3 \, b^{2} m + 2 \, b^{2}\right )} x^{3} + 2 \, {\left (a b m^{2} + 4 \, a b m + 3 \, a b\right )} x^{2} + {\left (a^{2} m^{2} + 5 \, a^{2} m + 6 \, a^{2}\right )} x\right )} x^{m}}{m^{3} + 6 \, m^{2} + 11 \, m + 6} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 299 vs.
\(2 (36) = 72\).
time = 0.17, size = 299, normalized size = 6.95 \begin {gather*} \begin {cases} - \frac {a^{2}}{2 x^{2}} - \frac {2 a b}{x} + b^{2} \log {\left (x \right )} & \text {for}\: m = -3 \\- \frac {a^{2}}{x} + 2 a b \log {\left (x \right )} + b^{2} x & \text {for}\: m = -2 \\a^{2} \log {\left (x \right )} + 2 a b x + \frac {b^{2} x^{2}}{2} & \text {for}\: m = -1 \\\frac {a^{2} m^{2} x x^{m}}{m^{3} + 6 m^{2} + 11 m + 6} + \frac {5 a^{2} m x x^{m}}{m^{3} + 6 m^{2} + 11 m + 6} + \frac {6 a^{2} x x^{m}}{m^{3} + 6 m^{2} + 11 m + 6} + \frac {2 a b m^{2} x^{2} x^{m}}{m^{3} + 6 m^{2} + 11 m + 6} + \frac {8 a b m x^{2} x^{m}}{m^{3} + 6 m^{2} + 11 m + 6} + \frac {6 a b x^{2} x^{m}}{m^{3} + 6 m^{2} + 11 m + 6} + \frac {b^{2} m^{2} x^{3} x^{m}}{m^{3} + 6 m^{2} + 11 m + 6} + \frac {3 b^{2} m x^{3} x^{m}}{m^{3} + 6 m^{2} + 11 m + 6} + \frac {2 b^{2} x^{3} x^{m}}{m^{3} + 6 m^{2} + 11 m + 6} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 117 vs.
\(2 (43) = 86\).
time = 1.92, size = 117, normalized size = 2.72 \begin {gather*} \frac {b^{2} m^{2} x^{3} x^{m} + 2 \, a b m^{2} x^{2} x^{m} + 3 \, b^{2} m x^{3} x^{m} + a^{2} m^{2} x x^{m} + 8 \, a b m x^{2} x^{m} + 2 \, b^{2} x^{3} x^{m} + 5 \, a^{2} m x x^{m} + 6 \, a b x^{2} x^{m} + 6 \, a^{2} x x^{m}}{m^{3} + 6 \, m^{2} + 11 \, m + 6} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.37, size = 93, normalized size = 2.16 \begin {gather*} x^m\,\left (\frac {a^2\,x\,\left (m^2+5\,m+6\right )}{m^3+6\,m^2+11\,m+6}+\frac {b^2\,x^3\,\left (m^2+3\,m+2\right )}{m^3+6\,m^2+11\,m+6}+\frac {2\,a\,b\,x^2\,\left (m^2+4\,m+3\right )}{m^3+6\,m^2+11\,m+6}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________